<?
session_start();
include('admin/bd.php');
Conectar();
$meta_b=mysql_query("SELECT name, modle FROM products WHERE code='".$_GET[code]."'");
while($row_meta = mysql_fetch_array($meta_b, MYSQL_ASSOC)){
$meta=$row_meta[name].' '.$row_meta[modle];
}
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
 <HEAD>
  <TITLE> Bidetoday - Add Freshers to your life </TITLE>
  <META NAME="Generator" CONTENT="DILAPER">
  <META NAME="Author" CONTENT="Power by Sebastian Costa - Design: Nadia De Cinti">
  <META NAME="Keywords" CONTENT="">
  <META NAME="Description" CONTENT="<?echo$meta?>">
<meta content="text/html; charset=ISO-8859-1" http-equiv="content-type"/>
  <U><link href="style.css" rel="stylesheet" type="text/css"></U>
  <script src="js/botonera.js" type="text/javascript"></script>
  <script type="text/javascript" src="js/pngfix.js"></script>



 </HEAD>
 <BODY topmargin="0">
<center>

<table width="990" height="100%" cellspacing="0" cellpadding="0" class="fondo" border="0">
	<tr>
		<td width="990" height="100%" align="center" valign="top">
<?include('inc/head.php');?>
	<table width="740" cellspacing="0" cellpadding="0" border="0" valign="top">
		<tr>
			<td valign="top" align="center">
<?include('inc/menu_head.php');?>
			</td>
		</tr>
		<tr>
			<td valign="top" align="center">
	<table width="740" cellspacing="0" cellpadding="0" border="0" valign="top" class="tabla_principal_up">
		<tr>
			<td align="left">
<?include('inc/menu_search.php');?>
			</td>
		</tr>
		<tr>
			<td class="fondo_titulo" height="27" align="left"><!-- titulo de la pantalla -->
<div style="margin-left: 25px;">Products</div>			
			</td>
		</tr>
		<tr>
			<td align="center">
<!-- contenido -->
<table border="0" cellspacing="0" cellpadding="0">
	<tr>
		<td width="140" valign="top">
<!-- botonera home -->
<?include('inc/menu_products.php');?>
<!-- fin botonera fin -->
		</td>
		<td width="40" class="sombra_left">
&nbsp;
		</td>
		<td width="500" height="405" class="tabla_central" valign="top" align="center">
	<div style="margin: 5px; margin-top: 8px;">
<?
$result=mysql_query("SELECT * FROM products WHERE code='".$_GET[code]."'");
while($row = mysql_fetch_array($result, MYSQL_ASSOC)){
?>
<form name="cart" method="POST" action="acciones/cart_suma.php">
<input type="hidden" name="code" value="<?echo$row[code]?>">
<input type="hidden" name="price" value="<?echo$row[price]?>">
<input type="hidden" name="nombre" value="<?echo$row[name]?>">
<input type="hidden" name="modelo" value="<?echo$row[modle]?>">
<input type="hidden" name="peso" value="<?echo$row[peso]?>">
<input type="hidden" name="width" value="<?echo$row[width]?>">
<input type="hidden" name="height" value="<?echo$row[lenght]?>">
<input type="hidden" name="lenght" value="<?echo$row[lenght]?>">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
	<tr>
		<td class="tabla_productos" height="20">
<div style="margin-left: 10px; margin-bottom: 1px;">Featured item</div>
		</td>
	</tr>
	<tr>
		<td valign="top">
<div style="margin-left: 5px; margin-top: 5px">
	<table width="450" border="0" cellspacing="0" cellpadding="0">
		<tr>
			<td width="215" valign="bottom" align="left">
				<table width="215" height="200" border="0" cellspacing="0" cellpadding="0" style="border: 1px solid #000000;">
					<tr>
						<td width="215" align="center" valign="top">
<table width="200" border="0" cellspacing="0" cellpadding="0">
	<tr>
		<td height="210" align="center" valign="middle" style="border-top: 1px dotted #000000;" colspan="4" bgcolor="#ffffff">
<?if(file_exists('img_products/'.$row[code].'-1.jpg')){?>
<img src="img_products/<?echo $row[code]?>-1.jpg" name="principal"><?}?><br>
		</td>
	</tr>
	<tr>
		<td align="center" bgcolor="#ffffff" height="60">
<?if(file_exists('img_products/'.$row[code].'-1.jpg')){?>
<img src="img_products/<?echo $row[code]?>-1_c.jpg" id="foto1" onmouseover="javascript:ima('img_products/<?echo $row[code]?>-1.jpg')" style="cursor: pointer;"><?}?>
		</td>
		<td align="center" bgcolor="#ffffff">
<?if(file_exists('img_products/'.$row[code].'-2.jpg')){?>
<img src="img_products/<?echo $row[code]?>-2_c.jpg" id="foto2" onmouseover="javascript:ima('img_products/<?echo $row[code]?>-2.jpg')" style="cursor: pointer;"><?}?>
		</td>
		<td align="center" bgcolor="#ffffff">
<?if(file_exists('img_products/'.$row[code].'-3.jpg')){?>
<img src="img_products/<?echo $row[code]?>-3_c.jpg" id="foto3" onmouseover="javascript:ima('img_products/<?echo $row[code]?>-3.jpg')" style="cursor: pointer;"><?}?>
		</td>
		<td align="center" bgcolor="#ffffff">
<?if(file_exists('img_products/'.$row[code].'-4.jpg')){?>
<img src="img_products/<?echo $row[code]?>-4_c.jpg" id="foto4" onmouseover="javascript:ima('img_products/<?echo $row[code]?>-4.jpg');" style="cursor: pointer;"><?}?><br>
		</td>
	</tr>
</table>
						</td>
					</tr>
				</table>
			</td>
			<td width="25" style="background-image: url(img/barra_home.jpg); background-repeat: repeat-y; background-position: center"></td>
			<td width="160" valign="top" align="left">
			<div style="margin-right: 6px;" class="txt_productos">
<b><?echo$row[name]?></b><br>
<?if(file_exists('img_modle/'.$row[code].'.jpg')){?>
<img src="img_modle/<?echo $row[code]?>.jpg">
<?}else{echo$row[modle];}?><br>
<?
$price_d= substr($row[price], 0, strlen($row[price]) -2);
$price_c= substr($row[price], -2, 2);
?>
<b>$<?echo$price_d.'.'.$price_c?></b><br>
<br>
				<table width="160" height="140" border="0" cellspacing="0" cellpadding="0">
					<tr>
						<td width="160" align="left" valign="top" class="txt_productos">
<?
$result_c=mysql_query("SELECT * FROM shape ORDER BY shape DESC");
$w_s='1';
$cadena=$row[shape];
while($row_c = mysql_fetch_array($result_c, MYSQL_ASSOC)){
	$check_s='checked';
$palabra=preg_quote($row_c[shape]); 
if(eregi("[ a\t\n\r]+".$palabra."[ a\t\n\r]+",$cadena)){
	if($w_s=='1'){echo'Shape:<br>';}
	echo'<input type="radio" name="shape" value="'.$row_c[shape].'" '.$check_s.'>&nbsp;'.$row_c[shape].'<br>';}
$w_s++;}?>
<br>
<?
$result_c=mysql_query("SELECT * FROM color ORDER BY color DESC");
$w='1';
$cadena=$row[color];
while($row_c = mysql_fetch_array($result_c, MYSQL_ASSOC)){
	$check_c='checked';
$palabra=preg_quote($row_c[color]); 
if(eregi("[ a\t\n\r]+".$palabra."[ a\t\n\r]+",$cadena)){
	if($w=='1'){echo'Color:<br>';}
	echo'<input type="radio" name="color" value="'.$row_c[color].'" '.$check_c.'>&nbsp;'.$row_c[color].'<br>';
}	
$w++;}?>
<br>
<table border="0" class="txt_productos" cellspacing="0" cellpadding="0">
		<tr>
			<td>
QTY&nbsp;<input type="text" name="cantidad" size="2" value="1">&nbsp;&nbsp;
			</td>
			<td>
<!-- <input title="add to cart" alt="add to cart" src="img/add_to_cart-trans.png" type="image" onClick="document.cart.action='acciones/cart_suma.php'; document.cart.submit()">&nbsp;&nbsp; -->
<input title="add to cart" alt="add to cart" type="buttom" onclick="submit()" style="background-image: url(img/add_to_cart-trans.png); background-repeat: no-repeat; width: 83px; height: 22px; border: 0px; background-color: transparent; cursor: pointer;">&nbsp;&nbsp;
			</td>
		</tr>
		<tr><td height="20"></td></tr>
		<tr>
			<td colspan="2" align="left" height="20" class="btn_mail_productos"  style="cursor: pointer;"  onclick="javascript: document.getElementById('products_mail').style.display='block'; return false">
<div style="margin-bottom: 2px; margin-left: 12px;">tell as a friend</div>


			</td>	
		</tr>
	</table>
<div id="products_mail" style="z-index: 6; position: absolute; margin-top: -40px; display: none; border: 0; width: 300px; height: 480px;">
<?include('products_mail.php');?>
</div>
<br>
						</td>
					</tr>
				</table>
			</div>
			</td>
		</tr>
	</table>
</div>
		</td>
	</tr>
	<tr>
		<td align="center" class="txt_productos">
<br>
		</td>
	</tr>
	<tr>
		<td  height="80" align="left">
<br>
	<table width="490" border="0" class="txt_productos">
		<tr>
			<td valign="top" class="tabla_sub_productos" height="20">
<div style="margin-left: 10px; margin-bottom: 1px;">Promoted items</div>
			</td>
		</tr>
		<tr>
			<td>
<?
$result_r=mysql_query("SELECT * FROM promotions ORDER BY nombre DESC");
$e='0';
$x='0';
$w_r='0';
$as='1';
$cadena_r=$row[promotions];
while($row_r = mysql_fetch_array($result_r, MYSQL_ASSOC)){
$palabra_r=str_replace(' ', '', $row_r[code]); 
if(eregi("[ z\t\n\r]+".$palabra_r."[ z\t\n\r]+",$cadena_r)){?>
&nbsp;&nbsp;<input type="checkbox" name="promo_[<?echo$as;?>]" value="yes">&nbsp;Include&nbsp;<?echo'<b>'.$row_r[nombre].'</b><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'.$row_r[texto];?><br>
<input type="hidden" name="code_[<?echo$as;?>]" value="<?echo$row_r[code]?>">
<input type="hidden" name="nombre_[<?echo$as;?>]" value="<?echo$row_r[nombre]?>">
<input type="hidden" name="costo_[<?echo$as;?>]" value="<?echo$row_r[costo]?>">
<?$x++;$as++;}$e++;$w_r++;}?>
<input type="hidden" name="n_pormociones" value="<?echo$x?>"><br>
			</td>
		</tr>
	</table>
		</td>
	</tr>
	<tr>
		<td  height="20" align="right" valign="top">


		</td>
	</tr>
<!-- cierro form carrito ------------------------------------------------------------------------------------------------ -->
	<tr>
		<td class="tabla_sub_productos" height="20">
<div style="z-index: 1; position: absolute; margin-left: 5px; margin-top: -8px;">
	<table width="390" border="0" cellspacing="0" cellpadding="0" class="txt_sub_productos">
		<tr>
			<td align="center" id="txt_over" style="cursor: pointer;" onmouseover="javascript: document.getElementById('overview').style.display='block'; document.getElementById('details').style.display='none'; document.getElementById('install').style.display='none'; document.getElementById('warranty').style.display='none'; document.getElementById('faq').style.display='none'; document.getElementById('txt_over').style.color='#F4F4F4'; document.getElementById('txt_details').style.color='#F4F4F4'; document.getElementById('txt_install').style.color='#F4F4F4'; document.getElementById('txt_warranty').style.color='#F4F4F4'; document.getElementById('txt_faq').style.color='#F4F4F4'; this.style.color='#330066';">
Overview
			</td>
			<td align="center" id="txt_details" style="cursor: pointer;" onmouseover="javascript: document.getElementById('overview').style.display='none'; document.getElementById('details').style.display='block'; document.getElementById('install').style.display='none'; document.getElementById('warranty').style.display='none'; document.getElementById('faq').style.display='none'; document.getElementById('txt_over').style.color='#F4F4F4'; document.getElementById('txt_details').style.color='#F4F4F4'; document.getElementById('txt_install').style.color='#F4F4F4'; document.getElementById('txt_warranty').style.color='#F4F4F4'; document.getElementById('txt_faq').style.color='#F4F4F4'; this.style.color='#330066';">
Product Details
			</td>
			<td align="center" id="txt_install" style="cursor: pointer;" onmouseover="javascript: document.getElementById('overview').style.display='none'; document.getElementById('details').style.display='none'; document.getElementById('install').style.display='block'; document.getElementById('warranty').style.display='none'; document.getElementById('faq').style.display='none'; document.getElementById('txt_over').style.color='#F4F4F4'; document.getElementById('txt_details').style.color='#F4F4F4'; document.getElementById('txt_install').style.color='#F4F4F4'; document.getElementById('txt_warranty').style.color='#F4F4F4'; document.getElementById('txt_faq').style.color='#F4F4F4'; this.style.color='#330066';">
Installation
			</td>
			<td align="center" id="txt_warranty" style="cursor: pointer;" onmouseover="javascript: document.getElementById('overview').style.display='none'; document.getElementById('details').style.display='none'; document.getElementById('install').style.display='none'; document.getElementById('warranty').style.display='block'; document.getElementById('faq').style.display='none'; document.getElementById('txt_over').style.color='#F4F4F4'; document.getElementById('txt_details').style.color='#F4F4F4'; document.getElementById('txt_install').style.color='#F4F4F4'; document.getElementById('txt_warranty').style.color='#F4F4F4'; document.getElementById('txt_faq').style.color='#F4F4F4'; this.style.color='#330066';">
Warranty
			</td>
			<td align="center" id="txt_faq" style="cursor: pointer;" onmouseover="javascript: document.getElementById('overview').style.display='none'; document.getElementById('details').style.display='none'; document.getElementById('install').style.display='none'; document.getElementById('warranty').style.display='none'; document.getElementById('faq').style.display='block'; document.getElementById('txt_over').style.color='#F4F4F4'; document.getElementById('txt_details').style.color='#F4F4F4'; document.getElementById('txt_install').style.color='#F4F4F4'; document.getElementById('txt_warranty').style.color='#F4F4F4'; document.getElementById('txt_faq').style.color='#F4F4F4'; this.style.color='#330066';">
FAQ&nbsp;&nbsp;
			</td>
		</tr>
	</table>
</div>
		</td>
	</tr>
	<tr>
		<td>
<div style="margin-left: 6px; margin-bottom: 2px;">
	<table width="390" border="0" cellspacing="0" cellpadding="0" class="txt_productos">
		<tr>
			<td bgcolor="#ffffff" height="150" align="left" valign="top" style="border-left: 1px solid #000000; border-bottom: 1px solid #000000; border-right: 1px solid #000000; ">
<!-- espacios -->
<!-- over -->
<?
// de donde viene
if($_GET{view}=='install'){$_overview='none'; $_install='blok';}else{$_overview='block'; $_install='none';}
?>
<div id="overview" style="margin: 5px; width: 380px; background-color: #ffffff; display: <?echo$_overview;?>;" class="txt_productos">
<br>
<?echo $row[overview];?><br>
<br>
<center>
<?if(file_exists('img_overview/'.$row[code].'.jpg')){?>
<img src="../img_overview/<?echo $row[code]?>.jpg"><?}?></center><br>
<br>
<!-- data ----------------------------------------------------------------------------------------------------------------------- -->
<center>
<?if($row[measurement]){echo'<a href="product_data.php?code='.$row[code].'&q=measurement">Measurement</a>';}?>
&nbsp;&nbsp;
<?if($row[comparison_chart]){echo'<a href="comparison.php?code='.$row[code].'&q=comparsion">Comparison Chart</a>';}?>
&nbsp;&nbsp;
<?if($row[specification]){echo'<a href="product_data.php?code='.$row[code].'&q=specification">Specification</a>';}?>
&nbsp;&nbsp;
<?if($row[control_panel]){echo'<a href="product_data.php?code='.$row[code].'&q=control">Control Panel</a>';}?>
&nbsp;&nbsp;
<?if($row[size_shape]){echo'<a href="size_shape.php?code='.$row[code].'&q=size_shape">Size & Shape</a>';}?>
</center>
<!-- data fin ------------------------------------------------------------------------------------------------------------------ -->
</div>
<!-- details -->
<div id="details" style="margin: 5px; width: 380px; background-color: #ffffff; display: none;" class="txt_productos">
<br>
<?echo $row[details];?><br>
<br>
<center>
<?if(file_exists('img_details/'.$row[code].'.jpg')){?>
<img src="../img_details/<?echo $row[code]?>.jpg"><?}?></center><br>
</div>
<!-- installation -->
<div id="install" style="margin: 5px; width: 380px; background-color: #ffffff; display: <?echo$_install;?>;" class="txt_productos">
<br>
<B>TOOLS NEEDED FOR INSTALLATION</B><BR>
<br>	
<div style="z-index: 6;">
<form name="kit_carrito" action="acciones/cart_suma.php" method="POST">
<input type="hidden" name="price" value="1895">
<input type="hidden" name="nombre" value="TOOLS NEEDED FOR INSTALLATION">
<input type="hidden" name="cantidad" value="1">
<span onclick="document.getElementById('d_3000').style.display='block'" style="cursor: pointer;">Include Tool Set with your order- $18.95 </span>&nbsp;&nbsp;
<input title="add to cart" alt="add to cart" type="buttom" onclick="submit()" style="background-image: url(img/add_to_cart-trans.png); background-repeat: no-repeat; width: 83px; height: 22px; border: 0px; background-color: transparent; cursor: pointer;">
</form></div>
1/2" Drive Ratchet Handle<BR>
<BR>
1/2" Drive- 6 point 3/4" socket<BR>
<BR>
8" Slip Joint Pliers<BR>
<BR>
1/4" Flat Head Screw Driver<BR>
<br>
<?echo $row[installation];?><br>
<br>
<center>
<?if(file_exists('img_installation/'.$row[code].'.jpg')){?>
<img src="../img_installation/<?echo $row[code]?>.jpg"><?}?></center><br>
</div>
<!-- warranty -->
<div id="warranty" style="margin: 5px; width: 380px; background-color: #ffffff; display: none;" class="txt_productos">
<br>
<?echo $row[warranty];?><br>
<br>
<center>
<?if(file_exists('img_warranty/'.$row[code].'.jpg')){?>
<img src="../img_warranty/<?echo $row[code]?>.jpg"><?}?></center><br>
</div>
<!-- faq -->
<div id="faq" style="margin: 5px; width: 380px; background-color: #ffffff; display: none;" class="txt_productos">
<br>

<?
$result_faq=mysql_query("SELECT * FROM faq WHERE code='".$row[code]."' ORDER By id ASC");
while($row_faq = mysql_fetch_array($result_faq, MYSQL_ASSOC)){
	if($row_faq[pregunta]){$pregunta_=$row_faq[pregunta].'?<br>';}else{$pregunta_='';}
echo'<b>'.$pregunta_.'</b><br>
<div style="margin: 10px;">'.nl2br($row_faq[respuesta]).'</div><br>';
}?>

<br>
<center>
<?if(file_exists('img_warranty/'.$row[code].'.jpg')){?>
<img src="../img_warranty/<?echo $row[code]?>.jpg"><?}?></center><br>
</div>
			</td>
		</tr>
	</table>
</div>
		</td>
	</tr>
	<tr><td  height="20"></td></tr>
	<tr>
		<td class="tabla_sub_productos" height="20">
<div style="margin-left: 10px; margin-bottom: 2px;">Related products</div>
		</td>
	</tr>
	<tr>
		<td align="left" valign="top">
<div style="margin-left: 3px; margin-top: 0px; border: 1px solid #000000; border-top: 0px; width: 390px;  background-color: #ffffff;">
	<table width="380" border="0" class="txt_productos">
<tr>
<?
$result_r=mysql_query("SELECT code, name, modle FROM products ORDER BY name DESC");
$e='1';
$w='1';
$cadena_r=$row[parent];
while($row_r = mysql_fetch_array($result_r, MYSQL_ASSOC)){
$palabra_r=str_replace(' ', '', $row_r[modle]); 
if(eregi("[ x\t\n\r]+".$palabra_r."[ x\t\n\r]+",$cadena_r)){
	if($row_r[modle]!=$row[modle]){?>
			<td align="center" width="100">
<?echo'<a href="products.php?code='.$row_r[code].'">';?>
<?if(file_exists('img_products/'.$row_r[code].'-r.jpg')){?>
<img src="img_products/<?echo $row_r[code]?>-r.jpg" id="foto" border="0"><br>
<?echo'<b>'.$row_r[name].' '.$row_r[modle].'</a></b>';}?>
			</td>
<?}}else{
    $checked.$e='';
}$e++;$w++;}?>
		</tr>
	</table>
</div>
		</td>
	</tr>
	<tr><td  height="20"></td></tr>
	<tr>
		<td  height="10">
		
		</td>
	</tr>
</table>
</form>
<br>
<?}?>
	</div>
		</td>
		<td width="40" class="sombra_right">
&nbsp;
		</td>
	</tr>
	<tr>
		<td colspan="4" align="right">
		<div style="margin-right: 10px;">
	<table border="0" cellspacing="0" cellpadding="0">
		<tr>
			<td width="60" height="59" class="esq_left"></td>
			<td class="sombra_down" width="451"></td>
			<td width="60" class="esq_right"></td>
		</tr>
	</table>
		</div>
		</td>
	</tr>
</table>
<!-- fin contenido --------------------------------------------------------------------------------------------->
			</td>
		</tr>
		<tr>
			<td align="center" height="40" valign="top" align="center" class="tabla_foot">
<?include('inc/menu_foot.php');?>
			</td>
		</tr>
	</table>
			</td>
		</tr>
		<tr>
			<td valign="top" align="center" class="tabla_principal_down" height="10">
			</td>
		</tr>
	</table>
		</td>
	</tr>
</table>
<br>
</center>
 </BODY>
</HTML>
<?Desconectar();?>